var isTouch = Modernizr.touch,
	isMobile = false, //区分移动端与PC端
	mobile = false, //区分手机端与平板
	w_width = 0,
	w_height = 0,
	bannerImgh = 638,
	navItem = 0,
	h_height = 0,
	roll = 0,
	sTop = 150,
	produs = 0,
	ST = 0;

var _mousemove;
var _click;
var _mousedown;
var _mouseup;

//移动端事件和PC事件的切换
if (Modernizr.touch) {
	_mousemove = "touchmove";
	_click = "touchend";
	_mousedown = "touchstart";
	_mouseup = "touchend";
} else {
	_mousemove = "mousemove";
	_click = "click";
	_mousedown = "mousedown";
	_mouseup = "mouseup";
};

function pageBox() {
	w_width = jQuery(window).width();
	w_height = jQuery(window).height();


	//设置移动端参数
	if (w_width <= 1024) {
		isMobile = true;
	} else if (w_width > 1024) {
		isMobile = false;
	};
	//区分手机端和平板
	if (w_width <= 640) {
		mobile = true;
	} else if (w_width > 640) {
		mobile = false;
	};
}
pageBox();
jQuery(window).resize(function() {
	pageBox();
});



function setImgMax(img, imgW, imgH, tW, tH) {
	var tWidth = tW || w_width;
	var tHeight = tH || w_height;
	var coe = imgH / imgW;
	var coe2 = tHeight / tWidth;
	if (coe < coe2) {
		var imgWidth = tHeight / coe;
		img.css({
			height: tHeight,
			width: imgWidth,
			left: -(imgWidth - tWidth) / 2,
			top: 0
		});
	} else {
		var imgHeight = tWidth * coe;
		img.css({
			height: imgHeight,
			width: tWidth,
			left: 0,
			top: -(imgHeight - tHeight) / 2
		});
	};

};
